export const HttpStatus = {
  // 2xx Success
  OK: 200,
  CREATED: 201,
  ACCEPTED: 202,
  NO_CONTENT: 204,

  // 4xx Client Error
  BAD_REQUEST: 400,
  UNAUTHORIZED: 401,
  FORBIDDEN: 403,
  NOT_FOUND: 404,
  CONFLICT: 409,
  UNPROCESSABLE_ENTITY: 422,
  TOO_MANY_REQUESTS: 429,

  // 5xx Server Error
  INTERNAL_SERVER_ERROR: 500,
  NOT_IMPLEMENTED: 501,
  BAD_GATEWAY: 502,
  SERVICE_UNAVAILABLE: 503
} as const

// 错误信息映射
export const HttpMessage = {
  [HttpStatus.BAD_REQUEST]: '请求参数错误',
  [HttpStatus.UNAUTHORIZED]: '未登录或登录已过期',
  [HttpStatus.FORBIDDEN]: '没有权限访问',
  [HttpStatus.NOT_FOUND]: '请求的资源不存在',
  [HttpStatus.CONFLICT]: '资源冲突',
  [HttpStatus.UNPROCESSABLE_ENTITY]: '请求参数验证失败',
  [HttpStatus.TOO_MANY_REQUESTS]: '请求过于频繁',
  [HttpStatus.INTERNAL_SERVER_ERROR]: '服务器错误',
  [HttpStatus.BAD_GATEWAY]: '网关错误',
  [HttpStatus.SERVICE_UNAVAILABLE]: '服务不可用'
} as const
